package homeword;

public class 二维数组练习公司总营销额 {
    public static void main(String[] args) {
        int[][] yearArr = {{22, 66, 44}, {77, 33, 88}, {25, 45, 65}, {11, 66, 99}};
        int yearSum = 0;
        for (int i = 0; i < yearArr.length; i++) {
            int sum = 0;
            for (int j = 0; j < yearArr[i].length; j++) {
                sum += yearArr[i][j];
            }
            System.out.println("第" + (i + 1) + "个季度的总和是" + sum);
            yearSum += sum;
        }
        System.out.println("全年的总额是" + yearSum);
    }
}
